package com.lma.crm.staff.service.impl;

import java.util.List;

import com.lma.crm.staff.dao.CrmStaffDao;
import com.lma.crm.staff.domain.CrmStaff;
import com.lma.crm.staff.service.CrmStaffService;
import com.lma.crm.utils.MyStringUtils;

public class CrmStaffServiceImpl implements CrmStaffService {

	private CrmStaffDao crmStaffDao;
	public void setCrmStaffDao(CrmStaffDao crmStaffDao) {
		this.crmStaffDao = crmStaffDao;
	}
	
	@Override
	public CrmStaff login(CrmStaff crmStaff) {
		String loginPwd = MyStringUtils.getMD5Value(crmStaff.getLoginPwd());
		return crmStaffDao.find(crmStaff.getLoginName(), loginPwd);
	}

    @Override
    public List<CrmStaff> findAll() {
        return crmStaffDao.findAll();
    }

    @Override
    public CrmStaff findById(String staffId) {
        return this.crmStaffDao.findById(staffId);
    }

}
